package com.okoj.excel_lib_rary.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.okoj.excel_lib_rary.R;
import com.okoj.excel_lib_rary.data.entity.Template;
import com.okoj.excel_lib_rary.oss.OssManager;

public class TemplateAdapter extends BaseQuickAdapter<Template.SonFilesBean, BaseViewHolder> {

    public TemplateAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, Template.SonFilesBean item) {
        ImageView imageView = helper.getView(R.id.iv_cover);
        Glide.with(getContext())
                .load(OssManager.getInstance().getAuthUrl(item.getFilemodulemodel().getCover()))
                .error(R.mipmap.wps_err_template)
                .into(imageView);
        helper.setText(R.id.tv_title,item.getFilemodulemodel().getName())
        .setText(R.id.view_count,item.getViewCountString());
    }
}
